package com.example.mqdemo.rabbitmq.topic.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class TopicCoumer {

    //多队列绑定到一个交换机，生产者发送消息到交换机之后，多个队列可以消费
    @RabbitListener(queues = "xiaomi")
    public void topic(String msg){
        System.out.println("xiaomi测试" + msg);
    }
    @RabbitListener(queues = "huawei")
    public void topic2(String msg){
        System.out.println("huawei测试" + msg);
    }
    @RabbitListener(queues = "phone")
    public void topic3(String msg){
        System.out.println("phone测试" + msg);
    }
}
